package org.cogaen.demo.util;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;

import org.cogaen.resource.Polygon;

public class ResourceCreator {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Polygon poly = new Polygon();

		/*
		poly.addVertex( 0.0, 1.0);
		poly.addVertex(-1.0, -0.25);
		poly.addVertex(-1.0, -0.5);
		poly.addVertex(1.0, -0.5);
		poly.addVertex(1.0, -0.25);
		*/

		/*
		poly.addVertex(-1.0, -0.5);
		poly.addVertex(-1.0, -1.0);
		poly.addVertex(-0.5f, -0.5f);
		*/


		poly.addVertex(1.0f, -0.5f);
		poly.addVertex(0.5f, -0.5f);
		poly.addVertex(1.0f, -1.0f);
		
		/*
		poly.addVertex( 0.0,  1.0);
		poly.addVertex(-1.0,  -0.25);
		poly.addVertex(-1.0,  -1.0);
		poly.addVertex(-0.5, -0.5);
		poly.addVertex( 0.5, -0.5);
		poly.addVertex( 1.0, -1.0);
		poly.addVertex( 1.0, -0.25);
		*/
		
		OutputStream fos = null; 
		
		try {
			fos = new FileOutputStream("ship_3.ply");
			ObjectOutputStream o = new ObjectOutputStream( fos );
			o.writeObject( poly );
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

}
